#include <iostream>
#include "../cpp-httplib-master/httplib.h"


int main(){
    std::cout << "——————————————————服务启动——————————————————" << std::endl;
    httplib::Server server;

    server.Post("/test-post", [](const httplib::Request& req, httplib::Response& res){
        std::cout << "接收到 post 请求" << std::endl;
        res.status = 200;
    });
    server.Get("/test-get", [](const httplib::Request& req, httplib::Response& res){
        std::cout << "接收到 get 请求" << std::endl;
        res.status = 200;
    });

    // 绑定指定端口, 并将端口号开放
    server.listen("0.0.0.0", 8082);

    return 0;
}